﻿using DevExpress.XtraEditors;
using DevExpress.XtraReports.UI;
using DXApplicationTangche.report;
using DXApplicationTangche.UC.报表.service;
using DXApplicationTangche.UC.有赞.Service;
using DXApplicationTangche.UC.订单.service;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DXApplicationTangche.UC.报表
{
    public partial class Form半成品质检逾期 : DevExpress.XtraEditors.XtraForm
    {
        private List<ViewSemiCheckExceptionDao> viewSemiCheckExceptionDaos = new List<ViewSemiCheckExceptionDao>();
        public Form半成品质检逾期()
        {
            InitializeComponent();
            this.refreshata();
        }

        private void refreshata()
        {
            this.viewSemiCheckExceptionDaos = 抖音客户Service.getViewSemiCheckExceptionDao();
            for (int i = 0; i < viewSemiCheckExceptionDaos.Count; i++)
            {
                viewSemiCheckExceptionDaos[i].getPic();
            }
            this.gridControl半成品质检逾期.DataSource = viewSemiCheckExceptionDaos;
            this.advBandedGridView半成品质检逾期.RefreshData();
        }
        private void simpleButton1_Click(object sender, EventArgs e)
        {
            //this.gridViewXXX.ShowPrintPreview();//ShowPrintPreview相当于系统自带的打印预览可以输出为pdf
            XtraReport半成品质检逾期 re = new XtraReport半成品质检逾期(this.viewSemiCheckExceptionDaos);
            ReportPrintTool tool定制 = new ReportPrintTool(re);
            tool定制.ShowPreviewDialog();
        }

        private void simpleButton2_Click(object sender, EventArgs e)
        {
            //this.gridView抖音客户订单.ExportToXlsx(@"D:\导出excel\新建 Microsoft Excel 工作表.xlsx");//固定地址导出文件
            SaveFileDialog fileDialog = new SaveFileDialog();
            fileDialog.Title = "导出Excel";
            fileDialog.Filter = "Excel文件(*.xls)|*.xls";
            DialogResult dialogResult = fileDialog.ShowDialog(this);
            if (dialogResult == DialogResult.OK)
            {
                DevExpress.XtraPrinting.XlsExportOptions options = new DevExpress.XtraPrinting.XlsExportOptions();
                this.advBandedGridView半成品质检逾期.ExportToXls(fileDialog.FileName);
                DevExpress.XtraEditors.XtraMessageBox.Show("保存成功！", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                //选择地址保存文件
            }
        }
    }
}